#coding: utf-8

import gzip

def extract(src_file_name):
    des_file_name = src_file_name[:src_file_name.rfind(".")]

    gz_file = gzip.GzipFile(mode="rb", fileobj=open(src_file_name, "rb"))
    des_file = open(des_file_name, "w+")
    des_file.truncate(0)

    chunk_size = 65536
    while True:
        content = gz_file.read(chunk_size)
        if len(content) == 0:
            break

        des_file.write(content)

    des_file.close()
    return des_file_name
